' Test ae Sum gosub test B.txt 2018-02-07 adopted for BRUN from (flawed):
' yes this is dumb way to SUM, just testing a gosub
[
	? Enter some number to get sum of all pos integers to it, 0 quits; n
	isEmpty $= n,
	Jmp isEmpty
	If n >= 1
		GS sum:
	El
		Exit
	Fi
	. The sum of first ;n; integers is ; Sum:
	. 
]
. This ends the Sum gosub test.
End

Sum:
	' cant zero out Sum: with Sum: = 0 because Sum: is read as a label command when first in line
	' but can say
	*= Sum:,0
	sum_i = 0
	' and get Sum: in the variable table as 0
	[
		+= sum_i , 1
		Jmp sum_i > n
		+= Sum: , sum_i
	]
Rtn
